﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UserDetail.ascx.cs" Inherits="UserControls_UserDetail" %>
<asp:Panel ID="Panel1" runat="server" Height="236px">
    <asp:DetailsView ID="DetailsView1" runat="server" 
    Height="50px" Width="125px" AutoGenerateRows="False" DataKeyNames="Id" 
        DataSourceID="SqlDataSource">
        <Fields>
            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
            <asp:BoundField DataField="Mail" HeaderText="Mail" SortExpression="Mail" />
            <asp:BoundField DataField="Telephone" HeaderText="Telephone" 
                SortExpression="Telephone" />
            <asp:BoundField DataField="Address" HeaderText="Address" 
                SortExpression="Address" />
            <asp:BoundField DataField="Postcode" HeaderText="Postcode" 
                SortExpression="Postcode" />
            <asp:BoundField DataField="Remark" HeaderText="Remark" 
                SortExpression="Remark" />
            <asp:CommandField ShowEditButton="True" />
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource" runat="server" 
        ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        DeleteCommand="DELETE FROM [UserInfo] WHERE [Id] = @original_Id AND [Name] = @original_Name AND [Password] = @original_Password AND [Mail] = @original_Mail AND [Telephone] = @original_Telephone AND [Address] = @original_Address AND [Postcode] = @original_Postcode AND [CreateDate] = @original_CreateDate AND [State] = @original_State AND [Remark] = @original_Remark" 
        InsertCommand="INSERT INTO [UserInfo] ([Name], [Password], [Mail], [Telephone], [Address], [Postcode], [CreateDate], [State], [Remark]) VALUES (@Name, @Password, @Mail, @Telephone, @Address, @Postcode, @CreateDate, @State, @Remark)" 
        OldValuesParameterFormatString="original_{0}" 
        SelectCommand="SELECT * FROM [UserInfo] WHERE ([Name] = @Name)" 
        UpdateCommand="UPDATE [UserInfo] SET [Name] = @Name, [Password] = @Password, [Mail] = @Mail, [Telephone] = @Telephone, [Address] = @Address, [Postcode] = @Postcode, [CreateDate] = @CreateDate, [State] = @State, [Remark] = @Remark WHERE [Id] = @original_Id AND [Name] = @original_Name AND [Password] = @original_Password AND [Mail] = @original_Mail AND [Telephone] = @original_Telephone AND [Address] = @original_Address AND [Postcode] = @original_Postcode AND [CreateDate] = @original_CreateDate AND [State] = @original_State AND [Remark] = @original_Remark">
        <SelectParameters>
            <asp:SessionParameter Name="Name" SessionField="Username" Type="String" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="original_Id" Type="Int32" />
            <asp:Parameter Name="original_Name" Type="String" />
            <asp:Parameter Name="original_Password" Type="String" />
            <asp:Parameter Name="original_Mail" Type="String" />
            <asp:Parameter Name="original_Telephone" Type="String" />
            <asp:Parameter Name="original_Address" Type="String" />
            <asp:Parameter Name="original_Postcode" Type="String" />
            <asp:Parameter Name="original_CreateDate" Type="DateTime" />
            <asp:Parameter Name="original_State" Type="String" />
            <asp:Parameter Name="original_Remark" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Password" Type="String" />
            <asp:Parameter Name="Mail" Type="String" />
            <asp:Parameter Name="Telephone" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="Postcode" Type="String" />
            <asp:Parameter Name="CreateDate" Type="DateTime" />
            <asp:Parameter Name="State" Type="String" />
            <asp:Parameter Name="Remark" Type="String" />
            <asp:Parameter Name="original_Id" Type="Int32" />
            <asp:Parameter Name="original_Name" Type="String" />
            <asp:Parameter Name="original_Password" Type="String" />
            <asp:Parameter Name="original_Mail" Type="String" />
            <asp:Parameter Name="original_Telephone" Type="String" />
            <asp:Parameter Name="original_Address" Type="String" />
            <asp:Parameter Name="original_Postcode" Type="String" />
            <asp:Parameter Name="original_CreateDate" Type="DateTime" />
            <asp:Parameter Name="original_State" Type="String" />
            <asp:Parameter Name="original_Remark" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Password" Type="String" />
            <asp:Parameter Name="Mail" Type="String" />
            <asp:Parameter Name="Telephone" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="Postcode" Type="String" />
            <asp:Parameter Name="CreateDate" Type="DateTime" />
            <asp:Parameter Name="State" Type="String" />
            <asp:Parameter Name="Remark" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
</asp:Panel>
